#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QQueue>

namespace Ui {
class MainWindow;
}

class QStandardItemModel;
class QStandardItem;

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void updateHistory();
    void startNewSale();
protected slots:
    void setup();
    void readSellersList();
    void readSalesPoint();
    void slotSalesCleared();
    //void addEmptySalesRow();
    //void clearSalesRows();
    bool saveSaleToFile();
    
private slots:
    void on_leSalesPoint_editingFinished();

    void on_actionSchliessen_triggered();

    void on_cbNewSale_clicked();

    void on_cbCancelSale_clicked();

   // void slotItemChanged ( QStandardItem * item );

    void on_toolButtonRemoveLine_clicked();

    void on_cbCompleteSale_clicked();

    void on_actionEinstellungen_triggered();

    void updateViews();

private:
    Ui::MainWindow *ui;
    QStandardItemModel *m_sellerModel;
    QStandardItemModel *m_salesModel;
    QString m_salesPointName;
    bool m_showQty;
    //QQueue<QString> m_lastSales;

    void closeEvent(QCloseEvent *event);
    void restoreSettings();
    void saveSettings();
    void calculateTotalSum();
};

#endif // MAINWINDOW_H
